package com.hyfrogx.modules.zoom.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hyfrogx.common.utils.QueryExt;
import com.hyfrogx.modules.zoom.dao.HyZoomVipUserDao;
import com.hyfrogx.modules.zoom.entity.HyZoomVipUserEntity;
import com.hyfrogx.modules.zoom.service.HyZoomVipUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author liubin on 2019/3/28.
 */
@Service("HyZoomVipUserService")
public class HyZoomVipUserServiceImpl extends ServiceImpl<HyZoomVipUserDao, HyZoomVipUserEntity> implements HyZoomVipUserService {

    @Autowired
    HyZoomVipUserDao zoomVipUserDao;

    @Override
    public Integer add(HyZoomVipUserEntity zoomVipUserEntity){
        zoomVipUserEntity.setCreateat(new Date());
        return zoomVipUserDao.insert(zoomVipUserEntity);
    }

    @Override
    public Page selectPageByConditions(QueryExt query) {
        Map map = new HashMap();
        map.putAll(query.getCondition());
        List<HyZoomVipUserEntity> result = zoomVipUserDao.selectPageByConditions(query,map);
        query.setRecords(result);
        return  query;
    }

    @Override
    public List<HyZoomVipUserEntity> getSubAccountByUid(Integer uid) {
        return zoomVipUserDao.getSubAccountByUid(uid);
    }
}
